﻿@model Cl.AuthorityManagement.Model.Mvc.ModuleElementEdit

@{
    Layout = null;
}

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title" id="modelTitle">@ViewBag.Operate 模块元素</h4>
</div>

@using (Ajax.BeginForm((string)ViewBag.Action, "ModuleElement", new AjaxOptions() { HttpMethod = "post", OnFailure = "saveFailure", OnSuccess = "saveSuccess" }, new { @id = "modelForm" }))
{
    @Html.AntiForgeryToken()
    
<div class="modal-body form-horizontal">
    @Html.ValidationSummary(true, "", new { @class = "text-danger" })
    @Html.HiddenFor(model => model.Id, new { @data_bind = "value:Id" })

    <div class="form-group">
        @Html.LabelFor(model => model.DomId, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.DomId, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:DomId", @placeholder = @Html.DisplayNameFor(model => model.DomId) } })
            @Html.ValidationMessageFor(model => model.DomId, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Name, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Name, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:Name", @placeholder = @Html.DisplayNameFor(model => model.Name) } })
            @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Type, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Type, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:Type", @placeholder = @Html.DisplayNameFor(model => model.Type) } })
            @Html.ValidationMessageFor(model => model.Type, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Attr, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Attr, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:Attr", @placeholder = @Html.DisplayNameFor(model => model.Attr) } })
            @Html.ValidationMessageFor(model => model.Attr, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Script, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Script, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:Script", @placeholder = @Html.DisplayNameFor(model => model.Script) } })
            @Html.ValidationMessageFor(model => model.Script, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Icon, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Icon, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:Icon", @placeholder = @Html.DisplayNameFor(model => model.Icon) } })
            @Html.ValidationMessageFor(model => model.Icon, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Class, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Class, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:Class", @placeholder = @Html.DisplayNameFor(model => model.Class) } })
            @Html.ValidationMessageFor(model => model.Class, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Remark, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Remark, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:Remark", @placeholder = @Html.DisplayNameFor(model => model.Remark) } })
            @Html.ValidationMessageFor(model => model.Remark, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Action, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Action, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:Action", @placeholder = @Html.DisplayNameFor(model => model.Action) } })
            @Html.ValidationMessageFor(model => model.Action, "", new { @class = "text-danger" })
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.Sort, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.Sort, new { htmlAttributes = new { @class = "form-control", @data_bind = "value:Sort", @placeholder = @Html.DisplayNameFor(model => model.Sort) } })
            @Html.ValidationMessageFor(model => model.Sort, "", new { @class = "text-danger" })
        </div>
    </div>
</div>
    <div class="modal-footer">
        <button type="button" id="close_edit" class="btn btn-primary" data-dismiss="modal">关闭</button>
        <button type="submit" class="btn btn-success">保存</button>
        <input type="hidden" id="page" name="page" />
    </div>
    <script type="text/javascript">
        $.validator.unobtrusive.parse('form');
    </script>
}
